var http = require('http');
var querystring = require('querystring');
http.createServer(function (req, res) {
    var post  = "";
    req.on('data', function (chunk) {
        post += chunk;
    });
    req.on('end', function () {
       var data = querystring.parse(post);
        // 设置响应头
        res.writeHead(200, {
            "Content-Type": "text/html;charset=utf-8"
        });
       res.end('用户名：' + data.username + ' 密码： ' + data.pwd);
    });
}).listen(8080);
console.log('this is running on http://127.0.0.1:8080');
